package com.sorhis.controller;

import com.sorhis.dto.SysParameterDTO;
import com.sorhis.dto.SysParametersDTO;
import com.sorhis.service.ISysParametersService;
import com.sorhis.vo.ResultVO;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 参数子表 前端控制器
 * </p>
 *
 * @author xihao.ding
 * @since 2025-02-25
 */
@RestController
@RequestMapping("/sysParameters/v1")
@RequiredArgsConstructor
public class SysParametersController {

    private final ISysParametersService sysParametersService;

    @GetMapping(value = "/list")
    public ResultVO search(SysParametersDTO sysParametersDTO) {
        return ResultVO.ok(sysParametersService.findPageList(sysParametersDTO));
    }


    @PostMapping(value = "/save")
    public ResultVO saveOrUpate(@RequestBody SysParametersDTO sysParametersDTO) {
        return ResultVO.ok(sysParametersService.saveOrUpateDomain(sysParametersDTO));
    }

    @PostMapping(value = "/del/{id}")
    public ResultVO del(@PathVariable String id) {
        return ResultVO.ok(sysParametersService.del(id));
    }



}
